package com.user.controller;

import com.common.utils.Result;
import com.user.pojo.dto.LoginDto;
import com.user.server.impl.LoginServerImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/login")
@Api(tags = "登录相关接口")
public class LoginController {

    @Autowired
    private LoginServerImpl loginServer;

    @Autowired
    private RedisTemplate redisTemplate;

    @PostMapping()
    @ApiOperation(value = "用户登录")
    public Result login(@RequestBody LoginDto loginDto){
        return loginServer.checkout(loginDto);
    }

}
